import home from "./pages/home";
import info from "./pages/info";
import room from "./pages/room";
import page404 from "./pages/page404";

/**
 * matchpath    用于匹配的路径
 * path         用作Route pathname的路径
 * component    路由显示组件
 * needsparams  路径是否需要params参数
 * auth         是否需要登录
 */
// 顺序有关, /info/setting 要在 /info 的前面, 不然匹配出问题
const router = [
    {                     path: '/home',          component: home,    needsparams: false, auth: false },
    {                     path: '/info/setting',  component: info,    needsparams: false, auth: true  },
    { matchpath: '/info', path: '/info/:id',      component: info,    needsparams: true,  auth: false },
    {                     path: '/room',          component: room,    needsparams: false, auth: true  },
    {                     path: '/404',           component: page404, needsparams: false, auth: false },
]

export default router;